using System;
using System.Collections.Generic;
using System.Text;

namespace My.IdlConverter.LoadManager
{
    public abstract class ConfigStrategy : IConfigStrategy
    {
        private object _target;
        private IComponentLoader _componentLoader;

        public virtual IComponentLoader ComponentLoader
        {
            get { return _componentLoader; }
            set { _componentLoader = value; }
        }

        public virtual object Target
        {
            get { return _target; }
            set { _target = value; }
        }

        public abstract void Makedisable();
        public abstract void Makeable();
        public abstract void Delete();

        protected T Check<T>() where T:class
        {
            T target = Target as T;
            if (target == null)
                throw new Exception("Config target should not be null.");

            return target;
        }
    }
}
